Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: check correct state machine when clearing status change ballots #7684

Merged
merged 4 commits into from
Jul 15, 2024

Conversation

rjsparks
Copy link
Member

Fixes #7335

@@ -403,7 +403,7 @@ def clear_ballot(request, name, ballot_type_slug):
by = request.user.person
if close_ballot(doc, by, ballot_type_slug):
create_ballot_if_not_open(request, doc, by, ballot_type_slug)
if doc.get_state('draft-iesg').slug == 'defer':
if doc.get_state("statchg").slug == "defer":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shoul have a guard against doc.get_state() returning None. (I think this is the cause of the failing test)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm - that just exposes another subtle bug - the check should be against the ballot_type_slug, and if there is no state, the view had best do nothing (404 would be right I think).

Copy link

codecov bot commented Jul 15, 2024

Codecov Report

Attention: Patch coverage is 88.88889% with 1 line in your changes missing coverage. Please review.

Project coverage is 88.79%. Comparing base (187c2c5) to head (080f5a8).
Report is 317 commits behind head on main.

Files Patch % Lines
ietf/doc/views_ballot.py 88.88% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7684      +/-   ##
==========================================
- Coverage   88.98%   88.79%   -0.20%     
==========================================
  Files         291      296       +5     
  Lines       40717    41318     +601     
==========================================
+ Hits        36233    36687     +454     
- Misses       4484     4631     +147     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rjsparks rjsparks merged commit 17e0f57 into ietf-tools:main Jul 15, 2024
9 checks passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 19, 2024
@rjsparks rjsparks deleted the clear_statchg_ballot branch September 16, 2024 13:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Attempts to clear a status change ballots crash
2 participants